@page "/Pie_Chart"

<Pie Data=data1 Config="config1" />

<Divider>动手实验</Divider>
<DynamicExample @ref="@example">
    <Pie @ref="@chart" />
</DynamicExample>

@code{

    public IChartComponent chart;
    DynamicExample example;

    protected override void OnAfterRender(bool firstRender)
    {
        base.OnAfterRender(firstRender);
        example.Chart = chart;
    }


    #region 示例1

    object[] data1 = new object[] {
        new  {
    type= "分类一",
    value= 27,
  },
        new  {
    type= "分类二",
    value= 25,
  },
        new  {
    type= "分类三",
    value= 18,
  },
        new  {
    type= "分类四",
    value= 15,
  },
        new  {
    type= "分类五",
    value= 10,
  },
        new  {
    type= "其它",
    value= 5,
  },
};

    PieConfig config1 = new PieConfig()
    {
        Radius = 0.8,
        AngleField = "value",
        ColorField = "type",
        Label = new PieLabelConfig()
        {
            Visible = true,
            Type = "inner",
        },
    };


    #endregion 示例1

}

